﻿<%@ Page Title="תקציבי מעסיקים" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="UserBudgets.aspx.cs" Inherits="TempEmployees.Web.UserBudgets" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table style="direction: rtl">
                <tr style="vertical-align: top">
                    <td>
                        <asp:Label ID="Label1" runat="server" Text="תקציבים:"></asp:Label>
                        <br />
                        <asp:DropDownList ID="BudgetTypeList" runat="server" AutoPostBack="true">
                            <asp:ListItem Text="טכניוני" Value="2" Selected="True"></asp:ListItem>
                            <asp:ListItem Text="מוסדי" Value="1"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        <br />
                        <asp:ListBox ID="BudgetsList" runat="server" DataSourceID="BudgetsDataSource"
                            DataTextField="ID" DataValueField="ID" OnSelectedIndexChanged="BudgetsList_SelectedIndexChanged"
                            AutoPostBack="true" Rows="10" ondatabound="BudgetsList_DataBound">
                        </asp:ListBox>
                    </td>
                    <td style="width: 50px">
                    </td>
                    <td>
                        <asp:Label ID="Label3" runat="server" Text="מעסיקים:"></asp:Label>
                        <br />
                        <asp:ListBox ID="UsersList" runat="server" OnSelectedIndexChanged="UsersDropDown_SelectedIndexChanged"
                            AutoPostBack="true" Rows="10">
                        </asp:ListBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:Label ID="Label2" runat="server" Text="תקציב חדש:"></asp:Label>
                        <br />
                        <asp:TextBox ID="NewBudgetTextBox" runat="server" AutoPostBack="false"></asp:TextBox>
                        &nbsp
                        <asp:Button ID="NewBudgetButton" runat="server" Text="הוסף" OnClick="NewBudgetTextBox_Click">
                        </asp:Button>
                        <br />
                        <asp:Label ID="BudgetExistsLabel" runat="server" Text="תקציב קיים במערכת" Visible="false"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <hr />
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:Label ID="LabelStatus" runat="server" Text=""></asp:Label>
                        <br />
                        <asp:Button ID="AssignBudgetButton" runat="server" Text="שיוך תקציב" OnClick="AssignBudgetButton_Click" />
                    </td>
                </tr>
            </table>
            <asp:LinqDataSource ID="BudgetsDataSource" runat="server" ContextTypeName="TempEmployees.DAL.EmpDatabaseDataContext"
                EntityTypeName="" Select="new (ID)" TableName="Budgets" Where="TypeID == @TypeID">
                <WhereParameters>
                    <asp:ControlParameter ControlID="BudgetTypeList" DefaultValue="1" Name="TypeID" PropertyName="SelectedValue"
                        Type="Int32" />
                </WhereParameters>
            </asp:LinqDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
